<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let money = 1000

        while (1) {

            let num = +prompt(`
                请选择你要的操作：
                1 取款
                2 存款
                3 查看余额
                4 退出
            `)
            if (num === 4) {
                break
            }
            switch (num) {
                case 1:
                    let qu = prompt(`请输入你要取款的金额`)
                    money -= qu
                    break
                case 2:
                    let cun = +prompt(`请输入你要存款的金额`)
                    money += cun
                    break
                case 3:
                    alert(`当前还有余额${money}`)
                    break
                default:
                    alert('看文字输入正确内容')
            }
        }
    </script>
</body>

</html>